;(function() {
  function resetHtmlFontSize() {
    let designWidth = 375,
        html = document.documentElement,
        deviceWidth = html.getBoundingClientRect().width,
        scale = deviceWidth / designWidth;
    html.style.fontSize =  scale * 10 + 'px'
  }
  resetHtmlFontSize();

  window.onresize = resetHtmlFontSize;

})(document.window);